{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "6eb081e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn  as nn\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "10df88e4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor(0.0307)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.randn(2,300).mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "20e7a35b",
   "metadata": {},
   "source": [
    "https://blog.csdn.net/dss_dssssd/article/details/83959474\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e1a99ca4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[-8.9483e+20,  1.9702e-42,  0.0000e+00],\n",
       "        [ 0.0000e+00,  0.0000e+00,  0.0000e+00],\n",
       "        [ 0.0000e+00,  0.0000e+00,  0.0000e+00]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s=torch.empty(3,3)\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "ec5db4c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[100.5307, 100.7195, 100.3885],\n",
       "        [100.4836, 100.2412, 100.9719],\n",
       "        [100.6418, 100.4616, 100.1238]])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.nn.init.uniform_(s, a=100, b=101)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "2344d9b4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[ 0.7298, -0.3928, -0.2267],\n",
       "        [ 2.0649,  0.7608, -0.2529],\n",
       "        [-1.3107,  0.3885, -0.5205]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.nn.init.normal_(s, mean=0, std=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41844725",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torch_py38",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.7rc1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
